package com20230218;

import java.util.Arrays;

public class RoseFlower2 {
    public static void main(String[] args) {
        //String[] str = rose();
        //System.out.println(Arrays.toString(str));
//        System.out.println(rose());
        rose();
    }

    public static String[] rose() {
            String str = "";
            for (int j = 1000; j < 10000; j++) {
                int q = j / 1000;
                int b = j / 100 % 10;
                int s = j / 10 % 10;
                int g = j % 10;
                if (Math.pow(q, 4) + Math.pow(b, 4) + Math.pow(s, 4) + Math.pow(g, 4) == j) {
                    str = str + j + " ";
                }
            }
            String[] arr = str.split(" ");
            System.out.println(Arrays.toString(arr));

        return arr;
    }

}
